Upgrading Applications
When an OLE 1
server is upgraded to an OLE 2 object application, several issues arise. A
primary issue is whether the OLE 2 application will replace the OLE 1
application or both versions will coexist. If only the newer version will be
available to the user, it is best to convert objects from the older version of
the application automatically to the new version format. Objects can be
converted on a global basis, where all objects of a specific class are
converted, or on a more selective basis, where only some objects are converted.
Conversion can be either automatic, under programmatic control, or under the
control of a user.
The ability
to detect whether an object is from an OLE 1 server is helpful for implementing
conversion functionality. The OLE 2 implementation of the IPersistStorage::Load
In the IPersistStorage::Save
To allow
manual conversion of an old OLE 1 object to the new OLE 2 version, the OLE 2
object application must put the OLE 1 server s ProgID (OLE 1 server class name)
into the registry under the CLSID\{ ...}\Conversion\Readable\Main entry.
This entry indicates that the OLE 2 application can read its OLE 1 data format;
the Clipboard format of the OLE 1 data is the ProgID (that is, the class
name) of the OLE 1 object.
To get a
CLSID for an OLE 1 server, the CLSIDFromProgId function or the CLSIDFromString
Refer to the
appendix called Registering Object Applications for detailed information on
the required registry entries for upgraded applications.